How to pass data between steps in a document workflow
This tutorial describes how to pass information between the activities that make up the steps of a document workflow. We will use as an example the workflow one might set up for cataloguing creditor invoices.
This example workflow is a simple, two-step cataloguing workflow. Our goal is to simplify the process of actually cataloguing the incoming document, so we will try and gather as much useful information as possible from the creditor journal activity; for this reason, the posting of the transaction should precede the cataloguing step:
To make the process as seamless as possible, the cataloguing step should immediately follow the posting of the transaction.
Among the properties for the second step of the document workflow is 'Directives required'. This is where outputs from the preceding activity are mapped onto inputs for the activity represented by the selected step. A single, atomic piece of information is referred to as a directive. Various activities within ContactsLaw support different sets of directives; sometimes as either input or output only, other times as both.
In this case, the key pieces of information that can be shared between the two activites are:
- The creditor contact - used for scoping in the first activity and as a document role in the second.
- The date of the invoice - used for the transaction in the first activity and as the document date in the second.
- The invoice number - used for reconciling in the first activity and in the description for the second.
- The total of the invoice - used for the transaction in the first activity and in the description for the second.
The 'pass data between activities' window lists the input directives for the selected step of the workflow down the side (along with named variables, which we will get to in a moment). The other columns are used to specify how and which information will be used to populate the directives. In addition to the obvious list of output directives from the preceding activity, you can also pull the information from:
- One of the dates from the document (of a specific type)
- One of the contacts from the document (in a specific role)
- The document description
- The file to which the document pertains
- A static value ("Advanced")
In this example, none of the above are useful because the document does not hold any such information at this point in its life cycle. (You would use these sources after cataloguing, not before.) When 'Directive' is chosen as the source of the mapping, the adjacent dropdown is populated with the output directives from the preceding activity.
All directives have concise, unambiguous names, however more verbose descriptions of each can be obtained by selecting each one and reading the documentation that appears at the bottom of the window. In some cases, the directive names will be the same, but in the case of this example, the mapping is as follows:
- ContactID maps to CreditorContactID
- DocumentDate maps to InvoiceDate
The difference in naming is due to less specific inputs being populated by more specific outputs.
You will have noticed that document cataloguing (and indeed the resultant document) has no provision to store either the invoice number or total. We can still add this information to the document, however, by including it in the document description. We use the same mechanism to achieve this, however special placeholders called named variables must first be added to the expression that is used to build the document description:
This is done either by inserting the variable into the expression in the form [$VariableName] or by adding the corresponding node to the tree on the side of the expression builder window. Once a variable appears in the description expression, it will be available for mapping.
Referring to the previous diagram for the 'pass data between activities' screen, you will see that the variables included in the description expression are shown below the input directives. These neatly map to InvoiceNo and TransactionTotal from the creditor journal activity.
As a result of the configuration of this document workflow, the process of registering a creditor invoice becomes vastly simplified:
- The creditor journal activity captures information that is on-hand at the time of registration.
- The selection of a contact for the document is limited to the list of creditors, and only needs to be provided once.
- The date of the document and the date of the invoice are the same, and only need to be provided once.
- The document will be automatically described with all relevant information, and its description will not need to be manually typed.
Further notes
Occasionally, you may wish to populate directives for an activity which are not represented by text or numbers; for example, a general account or disbursement journal type. ContactsLaw identifies these types of records internally, often using numbers or codes which are not displayed anywhere within the application. You can enter these numbers/codes directly if known, but as an alternative, you can instruct ContactsLaw to look up the desired record using a text hint. For example, to pre-populate a disbursement journal with the type 'Supreme court filing fee', you could enter 'supreme' into the mapping field.